﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MDP.WebOpenPortal.Controllers
{
    public class CommonController : Controller
    {
        public ActionResult PageNotFound()
        {
            this.Response.StatusCode = 404;
            this.Response.TrySkipIisCustomErrors = true;
            ViewBag.RawUrl = this.Request.RawUrl;
            return View();
        }

        public ActionResult UnknowError()
        {
            this.Response.StatusCode = 500;
            this.Response.TrySkipIisCustomErrors = true;
            string message = this.RouteData.Values["message"].ToString();
            Exception exception = new Exception(message);
            HandleErrorInfo errorInfo = new HandleErrorInfo(exception, "Common", "UnknowError");
            return View(errorInfo);
        }
    }
}